/*
 * Pointers, Arrays, References
 */

#include <array>
#include <iostream>
#include <limits>
#include <vector>

int increment(std::vector<int> &v) {
    for (auto &x : v) {
        if (x >= std::numeric_limits<int>::max())
            return 1;
        else
            x++;
    }
    return 0;
}

constexpr int MY_VSIZE = 6;

int increment_array(std::array<int, MY_VSIZE> &v) {
    for (auto &x : v) {
        if (x >= std::numeric_limits<int>::max())
            return 1;
        else
            x++;
    }
    return 0;
}

int main() {
    std::vector<int> v{0, 1, 2, 3, 4, 5};
    std::array<int, MY_VSIZE> ar{0, 1, 2, 3, 4, 5};
    increment(v);
    increment_array(ar);
    std::cout << "C++ Vector increment: " << std::endl;
    for (auto &x : v) {
        std::cout << x << std::endl;
    }
    std::cout << "C++ Array increment: " << std::endl;
    for (auto &x : ar) {
        std::cout << x << std::endl;
    }
    return 0;
}
